home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / BANDOG.ARJ / PASSWD.C < prev    next >
C/C++ Source or Header  |  1991-01-05  |  435b  |  24 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. main()
  6. {
  7.     int i, stime;
  8.     long ltime;
  9.  
  10.     /* Seed random number generator with current time */
  11.     ltime = time( NULL );
  12.     stime = (unsigned)ltime / 2;
  13.     srand( stime );
  14.  
  15.     /* Print three random letters */
  16.     for( i = 1; i <= 3; i++ )
  17.         putchar( rand() / 1260 + 65 );
  18.  
  19.     /* Print three random digits */
  20.     for( i = 1; i <= 3; i++ )
  21.         putchar( rand() / 3276 + 48 );
  22. }
  23.  
  24.